<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Percepio Trace Recorder: include/trcISR.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Percepio Trace Recorder<span id="projectnumber">&#160;v4.10.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('trcISR_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">trcISR.h</div></div>
</div><!--header-->
<div class="contents">
<a href="trcISR_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment">* Percepio Trace Recorder for Tracealyzer v4.10.3</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment">* Copyright 2023 Percepio AB</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment">* www.percepio.com</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment">*</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment">* SPDX-License-Identifier: Apache-2.0</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment">*/</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#ifndef TRC_ISR_H</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#define TRC_ISR_H</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#if (TRC_USE_TRACEALYZER_RECORDER == 1) &amp;&amp; (TRC_CFG_RECORDER_MODE == TRC_RECORDER_MODE_STREAMING)</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#include &lt;trcTypes.h&gt;</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span><span class="keyword">typedef</span> <span class="keyword">struct </span>TraceISRCoreData <span class="comment">/* Aligned */</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>{</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span>    TraceISRHandle_t handleStack[TRC_CFG_MAX_ISR_NESTING];  </div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span>    int32_t stackIndex;                                     </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span>    uint32_t isPendingContextSwitch;                            </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span>} TraceISRCoreData_t;</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="keyword">typedef</span> <span class="keyword">struct </span>TraceISRData <span class="comment">/* Aligned */</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span>{</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span>    TraceISRCoreData_t cores[TRC_CFG_CORE_COUNT]; <span class="comment">/* ISR handles */</span></div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span>} TraceISRData_t;</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno">   50</span><span class="comment">/* We expose this to enable faster access */</span></div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span><span class="keyword">extern</span> TraceISRData_t* pxTraceISRData;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span>traceResult xTraceISRInitialize(TraceISRData_t *pxBuffer);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>traceResult <a class="code hl_function" href="group__trace__isr__apis.html#ga0ef382e6e5964c8db9b807434b931921">xTraceISRRegister</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* szName, uint32_t uiPriority, TraceISRHandle_t* pxISRHandle);</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span> </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno">  104</span>traceResult <a class="code hl_function" href="group__trace__isr__apis.html#ga28db1b1d4243e36cb68178af0387206a">xTraceISRBegin</a>(TraceISRHandle_t xISRHandle);</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span> </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>traceResult <a class="code hl_function" href="group__trace__isr__apis.html#ga266d25f5ba9c184296268b44e8e3ce0a">xTraceISREnd</a>(TraceBaseType_t xIsTaskSwitchRequired);</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span><span class="preprocessor">#if ((TRC_CFG_USE_TRACE_ASSERT) == 1)</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>traceResult <a class="code hl_define" href="group__trace__isr__apis.html#ga00c946394372405d80af6ea398ccf18e">xTraceISRGetCurrentNesting</a>(int32_t* puiValue);</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span> </div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>int32_t <a class="code hl_define" href="group__trace__isr__apis.html#ga8b55f1af81e4016f931f45b855ac1804">xTraceISRGetCurrentNestingReturned</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span> </div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>traceResult <a class="code hl_define" href="group__trace__isr__apis.html#ga5d7c34b68726a077b7914c3420a59834">xTraceISRGetCurrent</a>(TraceISRHandle_t* pxISRHandle);</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span> </div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span><span class="preprocessor">#else </span><span class="comment">/* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="group__trace__isr__apis.html#ga00c946394372405d80af6ea398ccf18e">  168</a></span><span class="preprocessor">#define xTraceISRGetCurrentNesting(puiValue) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2(*(puiValue) = pxTraceISRData-&gt;cores[TRC_CFG_GET_CURRENT_CORE()].stackIndex, TRC_SUCCESS)</span></div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno">  169</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"><a class="line" href="group__trace__isr__apis.html#ga8b55f1af81e4016f931f45b855ac1804">  175</a></span><span class="preprocessor">#define xTraceISRGetCurrentNestingReturned() (pxTraceISRData-&gt;cores[TRC_CFG_GET_CURRENT_CORE()].stackIndex)</span></div>
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno">  176</span> </div>
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"><a class="line" href="group__trace__isr__apis.html#ga5d7c34b68726a077b7914c3420a59834">  188</a></span><span class="preprocessor">#define xTraceISRGetCurrent(pxISRHandle) (xTraceISRGetCurrentNestingReturned() &gt;= 0 ? (*(pxISRHandle) = pxTraceISRData-&gt;cores[TRC_CFG_GET_CURRENT_CORE()].handleStack[xTraceISRGetCurrentNestingReturned()], TRC_SUCCESS) : TRC_FAIL)</span></div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno">  189</span> </div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno">  190</span><span class="preprocessor">#endif </span><span class="comment">/* ((TRC_CFG_USE_TRACE_ASSERT) == 1) */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno">  191</span> </div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span>TraceISRHandle_t xTraceSetISRProperties(<span class="keyword">const</span> <span class="keywordtype">char</span>* szName, uint32_t uiPriority);</div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span> </div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno">  196</span><span class="preprocessor">#define xTraceGetCurrentISRNesting(puiValue) xTraceISRGetCurrentNesting(puiValue)</span></div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span> </div>
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno">  199</span><span class="preprocessor">#define vTraceStoreISRBegin(xISRHandle) xTraceISRBegin(xISRHandle)</span></div>
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno">  200</span> </div>
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno">  202</span><span class="preprocessor">#define vTraceStoreISREnd(xIsTaskSwitchRequired) xTraceISREnd(xIsTaskSwitchRequired)</span></div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno">  203</span> </div>
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno">  206</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span>}</div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno">  209</span> </div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span> </div>
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno">  212</span><span class="preprocessor">#define xTraceISRRegister(_szName, _uiPriority, _pxISRHandle) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_4((void)(_szName), (void)(_uiPriority), (void)(_pxISRHandle), TRC_SUCCESS)</span></div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno">  213</span> </div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno">  214</span><span class="preprocessor">#define xTraceISRBegin(_xISRHandle) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)(_xISRHandle), TRC_SUCCESS)</span></div>
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno">  215</span> </div>
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno">  216</span><span class="preprocessor">#define xTraceISREnd(_xIsTaskSwitchRequired) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)(_xIsTaskSwitchRequired), TRC_SUCCESS)</span></div>
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno">  217</span> </div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno">  218</span><span class="preprocessor">#define xTraceISRGetCurrentNesting(_puiValue) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)(_puiValue), 0)</span></div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span> </div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span><span class="preprocessor">#define xTraceISRGetCurrentNestingReturned() (1)</span></div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span> </div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span><span class="preprocessor">#define xTraceISRGetCurrent(_pxISRHandle) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_2((void)(_pxISRHandle), TRC_SUCCESS)</span></div>
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno">  223</span> </div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno">  225</span><span class="preprocessor">#define xTraceSetISRProperties(_szName, _uiPriority) TRC_COMMA_EXPR_TO_STATEMENT_EXPR_3((void)(_szName), (void)(_uiPriority), TRC_SUCCESS)</span></div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno">  226</span> </div>
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno">  228</span><span class="preprocessor">#define xTraceGetCurrentISRNesting(_puiValue) xTraceISRGetCurrentNesting(_puiValue)</span></div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno">  229</span> </div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span><span class="preprocessor">#define vTraceStoreISRBegin(_xISRHandle) xTraceISRBegin(_xISRHandle)</span></div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span> </div>
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno">  234</span><span class="preprocessor">#define vTraceStoreISREnd(_xIsTaskSwitchRequired) xTraceISREnd(_xIsTaskSwitchRequired)</span></div>
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno">  235</span> </div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno">  236</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno">  237</span> </div>
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno">  238</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="agroup__trace__isr__apis_html_ga00c946394372405d80af6ea398ccf18e"><div class="ttname"><a href="group__trace__isr__apis.html#ga00c946394372405d80af6ea398ccf18e">xTraceISRGetCurrentNesting</a></div><div class="ttdeci">#define xTraceISRGetCurrentNesting(puiValue)</div><div class="ttdoc">Gets current trace ISR nesting level.</div><div class="ttdef"><b>Definition:</b> trcISR.h:168</div></div>
<div class="ttc" id="agroup__trace__isr__apis_html_ga0ef382e6e5964c8db9b807434b931921"><div class="ttname"><a href="group__trace__isr__apis.html#ga0ef382e6e5964c8db9b807434b931921">xTraceISRRegister</a></div><div class="ttdeci">traceResult xTraceISRRegister(const char *szName, uint32_t uiPriority, TraceISRHandle_t *pxISRHandle)</div><div class="ttdoc">Registers trace ISR.</div><div class="ttdef"><b>Definition:</b> trcISR.c:47</div></div>
<div class="ttc" id="agroup__trace__isr__apis_html_ga266d25f5ba9c184296268b44e8e3ce0a"><div class="ttname"><a href="group__trace__isr__apis.html#ga266d25f5ba9c184296268b44e8e3ce0a">xTraceISREnd</a></div><div class="ttdeci">traceResult xTraceISREnd(TraceBaseType_t xIsTaskSwitchRequired)</div><div class="ttdoc">Registers the end of an Interrupt Service Routine.</div><div class="ttdef"><b>Definition:</b> trcCTI.c:1211</div></div>
<div class="ttc" id="agroup__trace__isr__apis_html_ga28db1b1d4243e36cb68178af0387206a"><div class="ttname"><a href="group__trace__isr__apis.html#ga28db1b1d4243e36cb68178af0387206a">xTraceISRBegin</a></div><div class="ttdeci">traceResult xTraceISRBegin(TraceISRHandle_t xISRHandle)</div><div class="ttdoc">Registers the beginning of an Interrupt Service Routine.</div><div class="ttdef"><b>Definition:</b> trcISR.c:94</div></div>
<div class="ttc" id="agroup__trace__isr__apis_html_ga5d7c34b68726a077b7914c3420a59834"><div class="ttname"><a href="group__trace__isr__apis.html#ga5d7c34b68726a077b7914c3420a59834">xTraceISRGetCurrent</a></div><div class="ttdeci">#define xTraceISRGetCurrent(pxISRHandle)</div><div class="ttdoc">Gets current trace ISR nesting level.</div><div class="ttdef"><b>Definition:</b> trcISR.h:188</div></div>
<div class="ttc" id="agroup__trace__isr__apis_html_ga8b55f1af81e4016f931f45b855ac1804"><div class="ttname"><a href="group__trace__isr__apis.html#ga8b55f1af81e4016f931f45b855ac1804">xTraceISRGetCurrentNestingReturned</a></div><div class="ttdeci">#define xTraceISRGetCurrentNestingReturned()</div><div class="ttdef"><b>Definition:</b> trcISR.h:175</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="trcISR_8h.html">trcISR.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6 </li>
  </ul>
</div>
</body>
</html>
